/**
 * 项目示例-列表表头
 * Date 2023-5-25 09:33:56
 * 可选参数可参考：https://element-plus.org/zh-CN/component/table.html#table-column-属性
 */
import { ref } from 'vue'
interface ExampleListItem {
  coordinate: string[]
  creator: string
  eqptCode: string
  eqptModel: string
  eqptName: string
  typeName: string
  useOrgans: string[]
  owner: string[]
  file: string
  lastMaintenanceTime: string
  maintainer: string
  maintenanceCycle: string
  terminal: string
  floor: string
  position: string
}

export const mapListColumns = [
  { type: 'index', label: '序号', width: 80, align: 'center' },
  {
    prop: 'eqptCode',
    label: '设备编号',
    sortable: true,
    width: 180,
    align: 'center',
    ellipsis: true,
  },
  {
    prop: 'typeName',
    label: '设备类型',
    minWidth: 140,
    align: 'center',
    ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'eqptName',
    label: '设备名称',
    width: 140,
    align: 'center',
    ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },

  {
    prop: 'eqptModel',
    label: '设备型号',
    minWidth: 140,
    align: 'center',
    ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'useOrgans',
    label: '使用部门',
    minWidth: 200,
    align: 'center',
    ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'ownerName',
    label: '归属单位',
    minWidth: 140,
    align: 'center',
    ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'file',
    label: '维护内容',
    minWidth: 200,
    align: 'center',
    ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'lastMaintenanceTime',
    label: '末次维护时间',
    width: 200,
    sortable: true,
    align: 'center',
    ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'maintainer',
    label: '维护执行人',
    minWidth: 140,
    align: 'center',
    ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'maintenanceCycle',
    label: '维护周期',
    sortable: true,
    minWidth: 150,
    align: 'center',
    ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'terminal',
    label: '航站楼',
    width: 100,
    sortable: true,
    align: 'center',
    ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'floor',
    label: '楼层',
    width: 100,
    sortable: true,
    align: 'center',
    ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'position',
    label: '位置',
    width: 200,
    align: 'center',
    ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return cellValue
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'coordinate',
    label: '地图坐标',
    width: 210,
    align: 'center',
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        return `(${cellValue.longitude}, ${cellValue.latitude})`
      } else {
        return '-'
      }
    },
    ellipsis: true
  },
  {
    prop: 'action',
    label: '操作',
    fixed: 'right',
    width: 220,
    align: 'center'
  }
]
